<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <!-- 引入 Bootstrap 样式（可选） -->
    <style>
        .login-container {
            max-width: 400px;
            margin: 100px auto;
            padding: 20px;
            border: 1px solid #ddd;
            border-radius: 5px;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="login-container">
        <h2 class="text-center mb-4">用户登录</h2>

        <!-- 错误提示 -->
        <div th:if="${param.error}" class="alert alert-danger">
            用户名或密码错误！
        </div>

        <!-- 登出提示 -->
        <div th:if="${param.logout}" class="alert alert-success">
            您已成功登出
        </div>

        <!-- 登录表单 -->
        <form th:action="@{/login}" method="post">
            <div class="mb-3">
                <label class="form-label">用户名</label>
                <input
                        type="text"
                        name="username"
                        class="form-control"
                        required
                />
            </div>
            <div class="mb-3">
                <label class="form-label">密码</label>
                <input
                        type="password"
                        name="password"
                        class="form-control"
                        required
                />
            </div>
            <button type="submit" class="btn btn-primary w-100">登录</button>
        </form>
    </div>
</div>
</body>
</html>